//uniform mat4 gl_ModelViewMatrix;
//uniform mat4 gl_ProjectionMatrix;
//instead of the ones above opengl also provides some predefined derived matrices
//uniform mat4 gl_ModelViewProjectionMatrix; // =gl_ProjectionMatrix * gl_ModelViewMatrix

attribute vec4 gl_Vertex;
 
attribute vec4 gl_Color;	//received from opengl

varying vec4 gl_FrontColor;	//results
varying vec4 gl_BackColor;

varying vec4 gl_Color; //is passed to fragment shader

void main(){

	//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
	//better: use predefined function ftransform() wich always does transforming in the right way, doing it manually
	//can cause sideeffects due to high optimization in graphics accelerator
	
	gl_FrontColor = gl_Color;
	gl_BackColor = vec4(-gl_Color.r,-gl_Color.g,-gl_Color.b,gl_Color[3]);
	
	gl_Position = ftransform();
}